<template>
    <div>
        <van-search
            v-model="txt"
            :placeholder="category.searchWord"
            show-action
            shape="round"
            @search="onSearch"
            >
            <van-button slot="action" @click="onSearch" round type="info" size="small">搜索</van-button>
        </van-search>
    </div>
</template>

<script>
import { mapState, mapActions } from 'vuex';
export default {
    data() {
        return {
            txt: '',
        }
    },
    methods: {
        onSearch() {
            console.log('onSearch')
        },
        ...mapActions(['getWordsList'])
    },
    computed: {
        ...mapState(['category'])
    },
    async mounted() {
        await this.getWordsList()
    }
}
</script>

<style lang="scss" scoped>
    .van-search {
        z-index: 99;
        background: #f0f0f0!important;
        .van-search__content {
            background: #fff;
        }
    }
</style>
